package com.sec.android.app.myfiles.shadow.custom;

import com.sec.android.app.myfiles.info.MimeType;
import com.sec.android.app.myfiles.info.SccFileUtil;

import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

import java.util.Locale;

/**
 * Created by jaebae on 2016-07-01.
 */

@Implements(SccFileUtil.class)
public class ShadowSccFileUtil {

    @Implementation
    public static String getMimetypeFromSCCFile(String path) {
        return getSccFIleMimeType(path.toUpperCase(Locale.getDefault()));
    }

    @Implementation
    public static boolean isSCCFile(String path) {
        return isSccFIle(path.toUpperCase(Locale.getDefault()));
    }


    private static String getSccFIleMimeType(String filePath) {
        String ret = null;
        if (filePath.contains("STORY")) {
            ret = MimeType.STORY_ALBUM;
        } else if (filePath.contains("SCRAP")) {
            ret = MimeType.SCRAP_BOOK;
        }
        return ret;
    }

    private static boolean isSccFIle(String filePath) {
        boolean bRet = false;
        if (filePath.contains("SCC")) {
            bRet = true;
        }
        return bRet;
    }

}
